package cn.csc.module.pay.dal.mysql.jzbrefund;

import cn.csc.framework.mybatis.core.mapper.BaseMapperX;
import cn.csc.module.pay.dal.dataobject.jzbrefund.PayJzbRefundDO;
import cn.csc.module.pay.dal.dataobject.jzbsuborder.PayJzbSubOrderDO;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import org.apache.ibatis.annotations.Mapper;

import java.math.BigInteger;

/**
 * 见证宝退款记录表(销账) Mapper
 *
 * @author liuchuang
 */
@Mapper
public interface PayJzbRefundMapper extends BaseMapperX<PayJzbRefundDO> {

    /**
     * 更新订单状态
     * @param orderId 见证宝订单ID
     * @param refundStatus 退款状态
     * @return
     */
    default Integer updateStatusByOrderId(BigInteger orderId, Integer refundStatus){
        LambdaUpdateWrapper<PayJzbRefundDO> userUpdateWrapper = new LambdaUpdateWrapper<>();
        userUpdateWrapper.set(PayJzbRefundDO::getRefundStatus, refundStatus);
        userUpdateWrapper.eq(PayJzbRefundDO::getOrderId, orderId);
        return update(null, userUpdateWrapper);
    }

}
